package com.wwg.cms.test.templs;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author 王文磊
 * @version $Id: SafeString.java 16 2010-08-30 07:15:17Z sanshi2 $
 * @date 2010-8-13 21:52:48
 */
public class SafeString implements TemplateMethodModel {
    public Object exec(List args) throws TemplateModelException {
        String NULL="";
        if(args.size()==1) {
            Object o=args.get(0);
           return o==null?NULL:o.toString();
        }
        return NULL;
    }
}
